<?php
/*
Description: This file is used to change login paassword.
*/
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
//	CHANGE PASSWORD	CODE	//

if( $_POST['changepwd']=='Change Password')
{
	if( $_POST['Password'] != $_POST['ConfirmPassword']){
		header("Location: change_pwd.php?err=passmismatch");
		exit;
	}
	if( AdminMaster::changePassword($_SESSION['sess_admin_name'],$_POST['TR_Old_Password'],$_POST['Password']) ) {
		$errMsg = 'passsuccess';
	}else{
		$errMsg = 'oldpassmismatch';
	
	}
	header("Location: change_pwd.php?err=".$errMsg);
	exit;
}

//	END CHANGE PASSWORD CODE	//
$errMsg = $_GET['err'];
$row = AdminMaster::adminLastLoginInfo();
$_tplName = 'change-password/change_password.tpl';
$_title = 'Change Password';
require_once _ADMIN_TPL_MAIN_;
?>